"""
:mod:`nubio.util.url`
=====================

Utility functions for using web-resources.

"""
from nubox.shim import urlencode, urlopen


def restful(url, params):
    """
    Retrieves a RESTful url via urllib
    
    Arguments:
    
      - url(``str``) URL-string
      - params(``dict``) A dictionary of valid parameters for ``urlencode``
      
    """
    params = urlencode(params)
    params = params.replace('%2B', '+')
    data = urlopen(url, params).read()
    return data









